#include "GConditionVar.h"
#include "GError.h"

namespace GThread
{
	// Description: Constructor
	// Return:
	// Notes:
	// -----------------------------------------------------
	GConditionVar::GConditionVar()
	{
		Variable = NULL;
	}

	// Description: Destructor
	// Return:
	// Notes:
	// -----------------------------------------------------
	GConditionVar::~GConditionVar()
	{
		Release( );
	}

	// Description: Returns weather the condition is created or not
	// Return:
	// Notes:
	// -----------------------------------------------------
	bool GConditionVar::IsCreated() const
	{
		return Variable != NULL;
	}

	// Description: Does nothing but interface completeness
	// Return:
	// Notes:
	// -----------------------------------------------------
	void GConditionVar::Release()
	{
		if (!IsCreated())
		{
			return;
		}

		// @NOTE: Cond var does not have a release routine

		delete Variable;
		Variable = NULL;
	}

}